<?php

namespace app\admin\model;

use app\admin\model\purcha\Data;
use think\Model;

class Warehouse extends Model
{
    // 表名
    protected $name = 'warehouse';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    
    // 追加属性
    protected $append = [

    ];
    public function getDidAttr($value){
        $dmodel = new Data();
        $dinfo = $dmodel->find($value);
        return $dinfo['shopid'];

    }
    public function getPublisherAttr($value){
        $model = model('admin');

        $dinfo = $model->where(array('userid'=>$value))->find();
        return $dinfo['username'];

    }
    public function getPidAttr($value){
        $model = new Purcha();

        $dinfo = $model->find($value);
        return $dinfo['order_id'];

    }






}
